<template>
 <div>
   <el-form :model="form" ref="form" size="medium">
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">待补货数量
         <el-tooltip effect="dark" content="商品库存低于多少时,提示补充库存" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10">
         <el-form-item prop="replenish">
           <el-input v-model="form.replenish" placeholder="待补货数量"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">库存不足预警
         <el-tooltip effect="dark" content="警戒库存提醒值" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10">
         <el-form-item prop="sub_stock">
           <el-input v-model="form.sub_stock" placeholder="库存不足预警"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">退货理由
         <el-tooltip effect="dark" content="配置退货理由，一行一个理由" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10">
         <el-form-item prop="return_reason">
           <el-input type="textarea" v-model="form.return_reason" placeholder="退货理由"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">自动收货时间
         <el-tooltip effect="dark" content="系统自动收货时间,单位(天),0为不设置自动收货" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10">
         <el-form-item prop="receive_time">
           <el-input v-model="form.receive_time" placeholder="自动收货时间"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">线下支付状态
         <el-tooltip effect="dark" content="线下支付状态" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10" class="ml-20">
         <el-form-item prop="offline_pay">
           <el-radio-group v-model="form.offline_pay">
             <el-radio :label="0">开启</el-radio>
             <el-radio :label="1">关闭</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">新订单提醒
         <el-tooltip effect="dark" content="当添加进新订单时,出现消息提醒" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10" class="ml-20">
         <el-form-item prop="new_order">
           <el-radio-group v-model="form.new_order">
             <el-radio :label="0">是</el-radio>
             <el-radio :label="1">否</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row class="pt-20">
       <el-col :span="4" class="ban-left">发货提醒
         <el-tooltip effect="dark" content="当订单审核成功进行发货时,出现消息提醒" placement="top-start">
           <i class="el-icon-info ml-15"></i>
         </el-tooltip>
       </el-col>
       <el-col :span="10" class="ml-20">
         <el-form-item prop="send_goods">
           <el-radio-group v-model="form.send_goods">
             <el-radio :label="0">是</el-radio>
             <el-radio :label="1">否</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-col>
     </el-row>
     <el-button @click="stock">库存不足提醒</el-button>
     <el-button @click="order">新订单提醒</el-button>
     <el-button @click="send">发货提醒</el-button>
     <el-row class="pt-20">
       <el-col :span="2" :offset="6"><el-button class="save" @click="submit">提 交</el-button></el-col>
     </el-row>
   </el-form>
 </div>
</template>

<script>
  export default {
    name: 'BasicSet',
    data () {
      return {
        form: {
          replenish: '20',
          sub_stock: '5',
          return_reason: '收到商品损坏了',
          receive_time: '7',
          offline_pay: 0,
          new_order: 0,
          send_goods: 0,
        }
      }
    },

    methods: {
      //提交
      submit() {
        this.$refs['form'].validate((valid) => {
          if (valid) {
            console.log(this.form)
            this.$message.success('成功!');
          } else {
            console.log('error submit!!');
            this.$message.error('失败!');
            return false;
          }
        });
      },

      stock() {
        this.$notify({
          title: '库存不足警告',
          message: 'xx商品库存不足，请及时调整！',
          type: 'warning'
        });
      },

      order() {
        this.$notify.info({
          title: '新订单提醒',
          message: '添加了一条新订单，请及时查看！'
        });
      },

      send() {
        this.$notify.success({
          title: '发货提醒',
          message: '订单已审核成功，请及时查看发货！'
        });
      }
    }
  }
</script>

<style>
</style>
